Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Add better support for default signatures in class definitions #692

Closed
wants to merge 5 commits into from
Closed

Add better support for default signatures in class definitions #692

wants to merge 5 commits into from

Conversation

blmage
Copy link

@blmage blmage commented Oct 12, 2017

This should fix #439 and fix #567, though I'm not sure whether the solution is satisfying enough (at least it does limit the number of required changes)

@alexbiehl
Copy link
Member

Thank you @mac-adder! I will have a look and think about it. I see why generating a new unique might be necessary but I have to think about the consequences.

@alexbiehl
Copy link
Member

alexbiehl commented Oct 13, 2017

So basically:

  • If you find a default method you give it a new, unique name
  • you store documentation for this new name
  • when rendering and we encounter a default method, we uniquify its name again to see if there is some documentation.

This seems to be the plan, right?

@alexbiehl
Copy link
Member

Two other points:

  • Is this also working for reexports?
  • And could you add a test for default methods?

@blmage
Copy link
Author

blmage commented Oct 16, 2017

Sorry for the delay ! (I needed some time to set up an environment where I could actually test the changes on the latest versions)

So, unique names are necessary to ensure that comments applied to default signatures will be preserved (unless we change how comments are stored), and using setNameUnique / deriveUnique gives us "transparent" unique names, which greatly limits the number of changes to be propagated compared to other potential solutions (but I agree that it may not feel completely reliable, so I'm looking forward to receiving feedback about it).

Regarding reexports, it was actually not fully working, and should now be fixed, thanks !

Also, I've just added the new test for default signatures, tell me if it looks fine

@RyanGlScott
Copy link
Member

@alexbiehl, I think it would be a good thing to have this in Haddock. Is there something more that needs to be done here?

@alexbiehl alexbiehl closed this May 9, 2018
@RyanGlScott
Copy link
Member

Did I miss something here? Why was this closed?

@alexbiehl
Copy link
Member

Oh Boy I have no idea

@alexbiehl
Copy link
Member

Aah. I just deleted the master branch and this pr targeted it. Maybe?

@RyanGlScott
Copy link
Member

Gotcha. I'm definitely interested in getting this into Haddock, so maybe I'll try to rebase this onto the ghc-8.4 branch when I get a chance.

@ntc2
Copy link
Contributor

ntc2 commented May 9, 2018

This PR was closed accidentally, see this comment for how to reopen.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants